
function addToCartzx(product_id, quantity,option_length) {
	quantity = typeof(quantity) != 'undefined' ? quantity : 1;
	if(option_length > 0){
		//addalltocartzx(product_id, quantity,option_length);
		$('.product_info').hide();
		
		$('#product_info_'+product_id).show();
	}else{
		
		$.ajax({
			url: 'index.php?route=checkout/cartzx/add',
			type: 'post',
			data: 'product_id=' + product_id + '&quantity=' + quantity,
			dataType: 'json',
			success: function(msg) {
				$('.success, .warning, .attention, .information, .error').remove();
				$("#cart_list").empty();
				$("#cart_list").append(msg);
				
			
			}
		});
	
	}
}
function addalltocartzx(product_id, quantity) {
	var product_info = 'product_info_'+product_id;
	$.ajax({
		url: 'index.php?route=checkout/cartzx/add&product_id=' + product_id + '&quantity=' + quantity,
		type: 'post',
		data: $('#'+product_info+' input[type=\'text\'], #'+product_info+' input[type=\'hidden\'], #'+product_info+' input[type=\'radio\']:checked, #'+product_info+' input[type=\'checkbox\']:checked, #'+product_info+' select, .'+product_info+' textarea'),
		dataType: 'json',
		success: function(msg) {
			$('.success, .warning, .attention, information, .error').remove();
	
			$("#cart_list").empty();
			$("#cart_list").append(msg);
			$('#product_info_'+product_id).hide();
		}
	});
}